#include "BonecoBrinquedoRoney.h"
#include <GL/glu.h>
#include "gllib/Objects.h"

void BonecoBrinquedoRoney::draw() {
    glEnable(GL_COLOR_MATERIAL);
    glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

    float mat_specular[] = {0.7, 0.7, 0.7, 1.0};
    float shininess = 20;

    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialf(GL_FRONT, GL_SHININESS, shininess);

    glPushMatrix();
    glColor3f(0, 1.0, 0);
    //glTranslated(0.0,0.0,0.0);
    //gllibSphere(1,50);
    //glTranslated(1.0,0.0,0.0);
    //gllibSphere(0.7,30);

    //frente
    glPushMatrix();
        glTranslatef(0.0,0.8,0.0);
        gllibSphere(1,50);
    glPopMatrix();
    //traseira
    glPushMatrix();
        glTranslatef(0.7,0.78,0.2);
        gllibSphere(0.8,30);
        glTranslatef(0.0,0.0,-0.5);
        gllibSphere(0.8,30);
    glPopMatrix();
    //Pescoço
    glPushMatrix();
        glTranslatef(-0.8,0.7,0.0);
        gllibSphere(0.9,30);
    glPopMatrix();
    //Rabo
    glPushMatrix();
        glTranslated(1.4,1,0.0);
        glScaled(1.3,0.5,0.5);
        gllibSphere(0.4,30);
    glPopMatrix();
    //Cabeça
    glPushMatrix();
        glTranslated(-1.7,0.6,0.0);
        glScaled(1.3,1,1);
        gllibSphere(0.6,30);
    glPopMatrix();
    //Anteperna
    glPushMatrix();
        glTranslated(-1.3,0.0,0.3);
        gllibSphere(0.4,30);
        glTranslated(0,0.0,-0.5);
        gllibSphere(0.4,30);
    glPopMatrix();
    //Batata esquerda
    glPushMatrix();
   // glColor3f(1.0, 0.8, 0.8);
        glTranslated(-1.3,-0.6,0.4);
        glRotatef(-30,0,0,0);
        glScaled(0.8,1.8,0.8);
        gllibSphere(0.3,30);
    glPopMatrix();
    ///Outra
    glPushMatrix();
    //glColor3f(1.0, 0.8, 0.8);
        glTranslated(-1.3,-0.6,-0.3);
        glRotatef(-30,0,0,0);
        glScaled(0.8,1.8,0.8);
        gllibSphere(0.3,30);
    glPopMatrix();
    glColor3f(0, 1, 0);
    //Anterperna direita
    glPushMatrix();
        glTranslated(1.2,0.0,0.2);
        glScaled(1,1.4,1);
        gllibSphere(0.35,30);
        glTranslated(0,0.0,-0.5);
        gllibSphere(0.35,30);
    glPopMatrix();
    //Pé Direito
    glPushMatrix();
        glTranslated(-1.5,-1.0,0.4);
        //glRotatef(-30,0,0,0);
        glScaled(0.8,0.3,0.5);
        gllibSphere(0.3,30);
    glPopMatrix();
    //Pé esquerdo
    glPushMatrix();
        glTranslated(-1.5,-1.0,-0.3);
        //glRotatef(-30,0,0,0);
        glScaled(0.8,0.3,0.5);
        gllibSphere(0.3,30);
    glPopMatrix();
    //Batata esquerda Final
    glPushMatrix();
        glTranslated(1.1,-0.6,0.2);
        glRotatef(30,0,1,1);
        glScaled(0.8,1.7,0.8);
        gllibSphere(0.3,30);
    glPopMatrix();
    ///Outra
    glPushMatrix();
        glTranslated(1.1,-0.6,-0.3);
        glRotatef(30,0,1,1);
        glScaled(0.8,1.7,0.8);
        gllibSphere(0.3,30);
    glPopMatrix();
    //Pé Direito Final
    glPushMatrix();
        glTranslated(1.0,-1.0,0.2);
        //glRotatef(-30,0,0,0);
        glScaled(0.8,0.3,0.5);
        gllibSphere(0.3,30);
    glPopMatrix();
    //Pé esquerdo Final
    glPushMatrix();
        glTranslated(1.0,-1.0,-0.3);
        //glRotatef(-30,0,0,0);
        glScaled(0.8,0.3,0.5);
        gllibSphere(0.3,30);
    glPopMatrix();
    //Dedos esquerdo Traseiro
    glPushMatrix();
        glTranslated(0.75,-1,-0.4);
        //glRotatef(-30,0,0,0);
        glScaled(1.2,1,1);
        gllibSphere(0.05,30);
        glTranslated(0,0,0.1);
        gllibSphere(0.05,30);
        glTranslated(0,0,0.1);
        gllibSphere(0.05,30);
    glPopMatrix();
    //Dedos Direito TRaseiro
    glPushMatrix();
        glTranslated(0.75,-1,0.1);
        //glRotatef(-30,0,0,0);
        glScaled(1.2,1,1);
        gllibSphere(0.05,30);
        glTranslated(0,0,0.1);
        gllibSphere(0.05,30);
        glTranslated(0,0,0.1);
        gllibSphere(0.05,30);
    glPopMatrix();
    //Dedos esquerdo Frente
    glPushMatrix();
        glTranslated(-1.75,-1,-0.4);
        //glRotatef(-30,0,0,0);
        glScaled(1.2,1,1);
        gllibSphere(0.05,30);
        glTranslated(0,0,0.1);
        gllibSphere(0.05,30);
        glTranslated(0,0,0.1);
        gllibSphere(0.05,30);
    glPopMatrix();
    //Dedos Direito Frente
    glPushMatrix();
        glTranslated(-1.75,-1,0.3);
        //glRotatef(-30,0,0,0);
        glScaled(1.2,1,1);
        gllibSphere(0.05,30);
        glTranslated(0,0,0.1);
        gllibSphere(0.05,30);
        glTranslated(0,0,0.1);
        gllibSphere(0.05,30);
    glPopMatrix();
    //Cabeça Pequena
    glPushMatrix();
        glTranslated(-2.4,0.6,0.0);
        glScaled(1.4,1,0.8);
        gllibSphere(0.2,30);
        glTranslated(-0.05,-0.2,0.0);
        glScaled(0.6,0.6,0.6);
        gllibSphere(0.12,30);
    glPopMatrix();
    //Orelhas
    glPushMatrix();
        glTranslated(-2.2,0.9,0.3);
        glScaled(1.3,1,1);
        gllibSphere(0.05,30);
        glTranslated(0,0,-0.6);
        gllibSphere(0.05,30);
    glPopMatrix();
    //Olho direito
    glPushMatrix();
        glColor3f(1,1,1);
        glTranslated(-2.42,0.7,0.2);
        glRotated(-30,-1,-0.5,1);
        glScaled(0.4,1.0,1);
        gllibSphere(0.05,30);
    glPopMatrix();
    //Olho esquerdo
    glPushMatrix();
        glColor3f(1,1,1);
        glTranslated(-2.42,0.7,-0.2);
        glRotated(-30,-1,0.8,1);
        glScaled(0.4,1.0,1);
        gllibSphere(0.05,30);
    glPopMatrix();
    //Olhos Dentro direito
    glPushMatrix();
        glColor3f(0,0,0);
        glTranslated(-2.4419,0.7,0.2);
        glRotated(-30,-1,-0.5,1);
        glScaled(0,1,1);
        gllibSphere(0.02,30);
    glPopMatrix();
    //Olho dentro esquerdo
    glPushMatrix();
        glColor3f(0,0,0);
        glTranslated(-2.4419,0.7,-0.2);
        glRotated(-30,-1,0.8,1);
        glScaled(0.4,1.0,1);
        gllibSphere(0.02,30);
    glPopMatrix();
    //Piso
    glPushMatrix();
        glTranslated(0,-1.09,0);
        glColor3f(1,1,0);
        gllibCylinder(2,0,30);
    glPopMatrix();
    //Gorro
    glPushMatrix();
        glColor3d(1,0,0);
        glTranslated(-2.0,1.3,0.0);
        gllibCone(0.2,0.6,30);
        glColor3d(1,1,1);
        gllibSphere(0.1,18);
        glTranslated(0,0.3,0);
        gllibSphere(0.03,18);
    glPopMatrix();
    //Rotatório
    glPushMatrix();
        glColor3d(1,0,0);
        glTranslated(0,-1.6,0);
        gllibCylinder(0.5,1,30);
        glTranslated(0.5,0,0);
        gllibCube(0.5);
        glColor3d(1,1,1);
        glTranslated(0.25,0,0);
        gllibCube(0.1);
    glPopMatrix();

    /*GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 };
       GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
       GLfloat specular[] = { 1.0, 1.0, 1.0, 1.0 };
       GLfloat position[] = { 0.0, 3.0, 2.0, 0.0 };
       GLfloat lmodel_ambient[] = { 0.4, 0.4, 0.4, 1.0 };
       GLfloat local_view[] = { 0.0 };*/

    glFlush();

    glDisable(GL_COLOR_MATERIAL);
    }




